#ifndef LOGGER_H_
#define LOGGER_H_

#include <boost/date_time.hpp>
#include <iostream>
#include <string>

class Logger
{
	public:
		Logger(std::string modulName)
		{
			myDateTime = boost::posix_time::to_simple_string(boost::posix_time::second_clock::local_time());
			myFile.open((modulName+".log").c_str(),std::ios_base::app);
		}

		~Logger(void)
		{
			myFile.close();
		}

		void Write(void)
		{
			std::cout << "Created: " << myDateTime << std::endl;
		}

		void WriteEx(std::string theMessage)
		{
			myDateTime = boost::posix_time::to_simple_string(boost::posix_time::second_clock::local_time());
			myFile << "Exception(" << myDateTime << ") :" << theMessage << std::endl;
		}

		void WriteMsg(std::string theMessage)
		{
			myDateTime = boost::posix_time::to_simple_string(boost::posix_time::second_clock::local_time());
			myFile << "Message(" << myDateTime << ") :" << theMessage << std::endl;
		}

	private:
		std::string myDateTime;
		std::ofstream myFile;
};

#endif